<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <input type="text" :value="1" id = 'input'>
</body>
<script>
    let input = document.getElementById('input')
    function update() {
    let value = new Date()
    const dateTme = new Date(value)
    const Y = dateTme.getFullYear()
    const M = dateTme.getMonth() + 1 < 10 ? "0" + (dateTme.getMonth() + 1) : dateTme.getMonth() + 1
    const D = dateTme.getDate() < 10 ? "0" + dateTme.getDate() : dateTme.getDate()
    const h = dateTme.getHours()< 10 ? "0" + dateTme.getHours() : dateTme.getHours()
    const m = dateTme.getMinutes() < 10 ? "0" + dateTme.getMinutes() : dateTme.getMinutes()
    const s = dateTme.getSeconds() < 10 ? "0" + dateTme.getSeconds() : dateTme.getSeconds()
    const time = Y + '-' + M + '-' + D + '-' + h + '-' + m + '-' + s
    // console.log(time, input);
    input.value = time
    }
    setInterval(update, 1000)
    // eval('var a = 123;console.log(a)')
    let a = 1
    function b() {
        console.log(a);
        var a = 2
    }
    b()

    
   
</script>

</html>